{extend name='template/base'}{/extend}
{block name='style'}{/block}
{block name='script'}{/block}
{block name='content'}
<div class="wrapper">
    <form class="form-horizontal" id="form" action="{:url('Index/change_password_save')}">
        <div class="box-body">
            <div class="form-group">
                <label class="col-sm-3 control-label">原密码</label>
                <div class="col-sm-6">
                    <input class="form-control" type="text" name="old_password"  datatype="*" nullmsg="请填写原密码">
                </div>
                <div class="col-sm-3"></div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">新密码</label>
                <div class="col-sm-6">
                    <input class="form-control" type="text" name="new_password"  datatype="*" nullmsg="请填写新密码">
                </div>
                <div class="col-sm-3"></div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">确认密码</label>
                <div class="col-sm-6">
                    <input class="form-control" type="text" name="confirm_password" recheck="new_password" errormsg="两次密码密码不一致" datatype="*" nullmsg="请输入确认密码">
                </div>
                <div class="col-sm-3"></div>
            </div>
            <div class="form-group">
                <div class="col-sm-9 col-sm-offset-3">
                    <button type="submit" class="btn btn-primary">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                    <button type="button" class="btn btn-default radius ml-20" onclick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
                </div>
            </div>
        </div>
    </form>
</div>
{/block}
{block name='script_extra'}

<script>
    $("#form").Validform({
        tiptype:2,
        showAllError:true,
        ajaxPost: true,
        callback: function (res) {
            if (res.success == true){
                layer.msg(res.message, {time: 1000},function () {
                    layer_close();
                    parent.location.reload();
                });
            }else{
                layer.alert(res.message);
            }
        }
    });
</script>
{/block}